﻿#include "MainWindow.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
    ui.setupUi(this);
    //打开相机
    pCamera = new Camera(false);
    pListener = new Listener(ui.previewLabel);
    pCamera->registerListener(pListener, GrabberListener::eFRAMEREADY);
    pCamera->openDevice();
}

void MainWindow::on_openBtn_clicked() {
    pCamera->startLive();
}

void MainWindow::on_closeBtn_clicked() {
    pCamera->stopLive();
    ui.previewLabel->clear();
}


